package com.nageoffer.shortlink.project.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nageoffer.shortlink.common.dto.project.biz.ShortLinkStatsRecordDTO;
import com.nageoffer.shortlink.common.dto.project.req.ShortLinkBatchCreateReqDTO;
import com.nageoffer.shortlink.common.dto.project.req.ShortLinkCreateReqDTO;
import com.nageoffer.shortlink.common.dto.project.req.ShortLinkUpdateReqDTO;
import com.nageoffer.shortlink.common.dto.project.resp.ShortLinkBatchCreateRespDTO;
import com.nageoffer.shortlink.common.dto.project.resp.ShortLinkCreateRespDTO;
import com.nageoffer.shortlink.common.dto.project.resp.ShortLinkGroupCountRespDTO;
import com.nageoffer.shortlink.common.dto.project.resp.ShortLinkPageRespDTO;
import com.nageoffer.shortlink.project.dao.entity.ShortLink;
import com.nageoffer.shortlink.project.dto.req.ShortLinkPageReqDTO;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.List;

public interface ShortLinkService extends IService<ShortLink> {
    ShortLinkCreateRespDTO createShortLink(ShortLinkCreateReqDTO reqParam) throws IOException;

    ShortLinkBatchCreateRespDTO createBatchShortLink(ShortLinkBatchCreateReqDTO reqParam) throws IOException;

    Page<ShortLinkPageRespDTO> getShortLinkPage(ShortLinkPageReqDTO reqParam);

    List<ShortLinkGroupCountRespDTO> groupShortLinkCount(List<String> reqParam);

    void shortLinkRedirect(String shortUri, HttpServletRequest request, HttpServletResponse response) throws IOException;

    void updateShortLink(ShortLinkUpdateReqDTO reqParam);

    void shortLinkStats(String fullShortUrl, String gid, ShortLinkStatsRecordDTO statsRecord);
}
